import request from "@/utils/request";
import { stringify } from "qs";
import { toFormData } from "@/utils/utils.jsx";

//分拣框列表
export async function getSortingBoxList(params) {
	return request(`/new-wms/sorting-box?${stringify(params)}`, { loading: true });
}
// 分拣框统计
export async function getSortingBoxStatistics(params) {
	return request(`/new-wms/sorting-box/statistics?${stringify(params)}`);
}

// 分拣筐释放
export async function sortingBoxRelease(params) {
	return request(`/new-wms/sorting-box/release-box`, {
		method: "post",
		data: params,
		loading: true
	});
}

//分拣墙列表
export async function getSortingWallList(params) {
	return request(`/new-wms/sorting-wall?${stringify(params)}`, { loading: true });
}

// 创建分拣墙
export async function addSortingWall(params) {
	return request(`/new-wms/sorting-wall`, {
		method: "post",
		data: params,
		loading: true
	});
}

// 修改分拣墙
export async function updateSortingWall(params) {
	return request(`/new-wms/sorting-wall`, {
		method: "put",
		data: params
	});
}
// 删除分拣墙
export async function deleteSortingWall(params) {
	return request(`/new-wms/sorting-wall?${stringify(params)}`, {
		method: "delete"
	});
}
// 分拣墙状态
export async function sortingWallStatus(params) {
	return request(`/new-wms/sorting-wall/status`, {
		method: "put",
		data: params
	});
}
//用户仓库下拉列表
export async function getWarehouseList() {
	return request(`/zjf-wms/warehouse/list`);
}

// 唯一码打印接口
export async function getPrintTemp(params) {
	return request(`/new-wms/fmcgpurchases/getPrintTemp?${stringify(params)}`);
}

// 修改唯一码配置
export async function uniqueconfigSubmit(params) {
	return request(`/new-wms/uniqueconfig/submit`, {
		method: "post",
		data: params
	});
}

// 拿货员列表
export async function queryTakeUserList(params) {
	return request(`/blade-user/childUsers?${stringify(params)}`);
}
//获取商品唯一码打印数据
export async function getPrintData(params) {
	return request(`/zjf-wms/hiprint/getTakeGoodsPrintData`, {
		method: "post",
		data: params
	});
}

//获取商品唯一码打印数据(已拿货列表筛选)
export async function queryTakenGoodsPrintData(params) {
	return request(`/zjf-wms/hiprint/getTakenGoodsPrintData`, {
		method: "post",
		data: params
	});
}

//获取商品唯一码打印数据
export async function getPrintDataByUniqeCode(params) {
	return request(`/zjf-wms/hiprint/getPrintUniqueCodes/uniqueCodes`, {
		method: "post",
		data: params,
		loading: true
	});
}
// 拆单
export async function outboundSplitOrder(params) {
	return request(`/new-wms/outboundorder/splitOrder`, {
		method: "post",
		data: params,
		loading: true
	});
}
// 强制发货
export async function outboundOrderBatchForce(params) {
	return request(`/new-wms/outboundorder/manual-delivery`, {
		method: "post",
		data: params,
		loading: true
	});
}

// 分拣框设置详情查询
export async function querySortingboxconfig(params) {
	return request(`/new-wms/sortingboxconfig/detail?${stringify(params)}`);
}

// 新增分拣框设置
export async function sortingboxconfigSave(params) {
	return request(`/new-wms/sortingboxconfig/save`, {
		method: "post",
		data: params,
	});
}

// 编辑分拣框设置
export async function sortingboxconfigUpdate(params) {
	return request(`/new-wms/sortingboxconfig/update`, {
		method: "post",
		data: params,
	});
}

//根据销售出库单号获取快递公司
export async function getExpressCompanyByOutboundNoListOp(params) {
	return request(`/new-wms/outboundorder/getExpressCompanyByOutboundNoList`, {
		method: "post",
		data: params,
	});
}

//根据仓库id查询已分拣完成的出库单
export async function getSortingDoneNum(params) {
	return request(`/new-wms/sorting-box/sortingDoneNum?${stringify(params)}`);
}